#include "widget.h"
#include "ui_widget.h"
#include "mylab.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(ui->mylabel, &MyLab::doubleClicked, this, &Widget::do_doubleClicked);
    //connect(ui->lab,SIGNAL(doubleClicked()),this,SLOT(do_doubleClick()));
}

Widget::~Widget()
{
    delete ui;
}

void Widget::mouseDoubleClickEvent(QMouseEvent *event)
{
    Q_UNUSED(event);
    ui->mylabel->setText("窗口被双击了");
    ui->mylabel->adjustSize();
}

void Widget::do_doubleClicked()
{
    ui->mylabel->setText("双击信号槽响应");
    ui->mylabel->adjustSize();
}



